package com.utils.thread;

/**
 * @Desc：
 * 
 * @Title：TestRunnable
 * @author: zhaoyangyang
 * @version: 1.0
 * @date: 2017年4月20日 下午8:45:07
 */
public class RunnableTest implements Runnable {
	private String name;

	public RunnableTest(String name) {
		super();
		this.name = name;
	}

	public void run() {
		for (int i = 0; i < 5; i++) {
			for (long k = 0; k < 100000000; k++)
				;
			System.out.println(name + ": " + i);
		}
	}

	public static class TestRunnable1 {
		public static void main(String[] args) {
			RunnableTest ds1 = new RunnableTest("阿三");
			RunnableTest ds2 = new RunnableTest("李四");

			Thread t1 = new Thread(ds1);
			Thread t2 = new Thread(ds2);

			t1.start();
			t2.start();
		}
	}

}
